home *** CD-ROM | disk | FTP | other *** search
- class TDisplObj {
- private:
- Boolean HiLiteState; // true : highlighted
- protected:
- TDisplObj(Rect r); // Only accessible to public descendants
- Rect fBoundRect;
- Pattern fObjPat;
- public:
- virtual void Draw(Pattern) {DebugStr("\pCall to TDisplObj::Draw");}
- virtual void Erase() {DebugStr("\pCall to TDisplObj::Erase");}
- virtual void DoContent() {DebugStr("\pCall to TDisplObj::DoContent");}
- virtual void DoIdle() { /* do nothing by default*/ }
- Rect GetBoundRect() {return fBoundRect;}
- void SetBoundRect(Rect theRect) {fBoundRect = theRect;}
- Pattern GetObjPat() {return fObjPat;}
- void SetObjPat(Pattern pat);
- void DragObj(Point*, Rect);
- };
-
- class TObjLink {
- friend class TObjList;
-
- TObjLink* fNext; // the link to the next object
- TDisplObj* fmyObj; // the object this link refers to
-
- // our constructor can take args for convenience;
- // they default to nil.
- TObjLink(TObjLink *n = nil, TDisplObj *v = nil);
- public:
- inline TObjLink* GetNext() { return fNext; };
- inline TDisplObj* GetmyObj() { return fmyObj; };
- inline void SetNext(TObjLink* aLink) { fNext = aLink; };
- inline void SetmyObj(TDisplObj* aObj) { fmyObj = aObj; };
- };
-
- class TObjList {
- TObjLink* fHeader; // the first link in our list
- int fNumObjs; // the number of elements in the list
-
- public:
- TObjList(void); ~TObjList(void);
-
- inline TObjLink* Header() { return fHeader; }
- inline int NumObjs() { return fNumObjs; }
-
- void AddObj(TDisplObj* obj);
- void RemoveObj(TDisplObj* obj);
- TDisplObj* FindObj(Point theLoc);
- };
-
-
- class TRoundRect : public TDisplObj {
- public:
- TRoundRect(Rect r);
- virtual void Draw(Pattern);
- virtual void Erase();
- private:
- short fOvalWidth, fOvalHeight; // curvature of rounded corners
- };
-
-
- class TOval : public TDisplObj {
- public:
- TOval(Rect r);
- virtual void Draw(Pattern);
- virtual void Erase();
- };
-
-
- class TRect : public TDisplObj {
- public:
- TRect(Rect r);
- virtual void Draw(Pattern);
- virtual void Erase();
- };
-
-